#!/bin/bash

#################################
#测试脚本
#################################

set -x

function check()
{
    wget https://gitee.com/spring_view/gtest/raw/master/test_googletest.cpp
    g++ -std=c++11 test_googletest.cpp -o test_googletest -lgtest -lgtest_main -lpthread
    ./test_googletest
    if [[ $? -eq 0 ]];then
        echo "RETURN SUCCESS"
    else
        echo "RETURN FAILED"
    fi
}

function main()
{
    ret=$(check)
    if [[ $ret == *'RETURN SUCCESS' ]];then
        echo "test scripts success"
    else
        echo "test scripts failed"
    fi
}
main


